package com.JingYan.elasticSearch.controller;

import com.JingYan.annotation.BaseResponse;
import com.JingYan.bo.IdBo;
import com.JingYan.domain.page.PageDomain;
import com.JingYan.elasticSearch.domain.PdocDwApplicationdata;
import com.JingYan.elasticSearch.service.PdocDwApplicationdataService;
import com.JingYan.validation.group.Select;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author DongJiaQi
 * @create 2022/12/15 15:30
 * @Description:
 */
@RestController
@BaseResponse
public class FileDataController {
    @Autowired
    PdocDwApplicationdataService pdocDwApplicationdataService;
    @PostMapping("/saveEs")
    public boolean saveEs(@RequestBody @Validated(Select.class) IdBo bo , @RequestBody @Validated PageDomain pageDomain){
        //pageDomain.startPage();
        pdocDwApplicationdataService.saveEs();
        return true;
    }


    @PostMapping("/listEs")
    public List<PdocDwApplicationdata> listEs(@RequestBody @Validated(Select.class) PdocDwApplicationdata bean , @RequestBody @Validated PageDomain pageDomain){
        return pdocDwApplicationdataService.listEs(bean,pageDomain);
    }
}
